/*
package com.ruoyi.fee.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class JPushServiceImpl implements MessagePushService {
    @Autowired
    private JPushClient jPushClient;

    @Override
    public void pushToUser(Long userId, String title, String content) {
        // 获取用户注册的设备ID
        String registrationId = userDeviceMapper.getRegistrationId(userId);
        if (StrUtil.isEmpty(registrationId)) {
            return;
        }

        // 构建推送消息
        PushPayload payload = PushPayload.newBuilder()
            .setPlatform(Platform.all())
            .setAudience(Audience.registrationId(registrationId))
            .setNotification(Notification.newBuilder()
                .addPlatformNotification(AndroidNotification.newBuilder()
                    .setAlert(content)
                    .setTitle(title)
                    .build())
                .addPlatformNotification(IosNotification.newBuilder()
                    .setAlert(content)
                    .setBadge(1)
                    .build())
                .build())
            .build();

        try {
            jPushClient.sendPush(payload);
        } catch (APIConnectionException | APIRequestException e) {
            log.error("推送消息失败", e);
        }
    }
}*/
